package com.defeng.dome;/**
 * @ProjectName: 7.19-rikao
 * @Package: com.defeng.dome
 * @ClassName: Dome
 * @Author: 86158
 * @Description: 测试
 * @Date: 2022/7/19 8:37
 * @Version: 1.0
 * 谢德丰
 */


public class Dome {
    public static void main(String[] args) {
        //1.循环输出1-10的数（10分）
        System.out.print("循环输出1-10的数:");
        for (int i = 1; i <=10; i++) {
            System.out.print(" "+i+"");
        }
        System.out.println("");
        //2.求1-100的和(15分)
        int a = 0;
        for (int i = 1; i <= 100; i++) {
            a+=i;
        }
        int b=0;
        System.out.println("1-100的和："+a);
        //3.求1-100的偶数和(25分)
        for (int i = 1; i <= 100; i++) {
            if(i%2==0){
                b+=i;
            }
        }
        ///5454554445454
        int c = 0;
        System.out.println("1-100的偶数和："+b);
        //4.求1+3+5+7+…+101的和（25分）
        for (int i = 1; i <= 101; i++) {
            if(i%2==1){
                c+=i;
            }
        }
        System.out.println("1+3+5+7+…+101的和："+c);
    }
}
